package com.mmsj;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class ButtonActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_button);

    }
    public void logButton(View view){
        Log.d("Log-ButtonActivity", "logButton");
    }
    public void logHello(View view){
        Log.d("Log-ButtonActivity", "Hello World");
    }
    public void logCat(View view){
        Log.d("Log-ButtonActivity", "喵喵~");
    }
    public void onClickButton(View view){
        // 获取控件
        Button b2 = findViewById(R.id.button2);
        b2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d("Log-ButtonActivity", "喵喵");

            }
        }
            );
        }

    }